import * as actionTypes from './action-type'

const defaultstate = {
    maindata: {},
    initdata:{},
    initswiper:[]
}

const reducer = (state = defaultstate, action:any) => {
    switch (action.type) {
        case actionTypes.CHANGE_MAINDATA:
            return {...state, maindata: action.data }
        case actionTypes.INIT_DESIGN:
            return {...state,initdata:action.data}
        case actionTypes.INIT_SWIPER:
            return {...state,initswiper:action.data}
        default:
            return state;
    }
}
export default reducer;